package com.boe.admin.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.boe.admin.entity.Annex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.boe.admin.model.vo.AnnexVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 附件 Mapper 接口
 * </p>
 *
 * @author Yuxh
 * @since 2022-11-03 13:17
 */
@Mapper
public interface AnnexMapper extends BaseMapper<Annex> {
    String basicView = "SELECT a.id,a.name,a.url , b.mobile FROM s_annex AS a LEFT JOIN s_user AS b ON (a.creator_id = b.id) ";
    //    String basicView = "SELECT a.*, b.mobile FROM s_annex AS a LEFT JOIN s_user AS b ON (a.creator_id = a.id) ";
    String querySql = "SELECT * from ( " + basicView + " ) as v ${ew.customSqlSegment}";

    @Select(querySql)
    List<AnnexVO> list(Page page, @Param("ew") Wrapper queryWrapper);
}
